﻿
namespace MathService
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks>http://html5pattern.com/</remarks>
    public static class RegExpConsts
    {
        public const string CreditCardNumber = "[0-9]{13,16}";
        public const string ICQNumber = @"([1-9])+(?:-?\d){4,}";
        public const string CharsAndDigits = "^[a-zA-Z0-9]+$";
        public const string CharsAndDigitsAndKirilic = "^[а-яА-ЯёЁa-zA-Z0-9]+$";
        public const string DomenName = @"^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$";
        public const string IPv4Address = @"((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)";
        public const string IPv6Address = "((^|:)([0-9a-fA-F]{0,4})){1,8}$";
        /// <summary>2-20 символов, которыми могут быть буквы и цифры, первый символ обязательно буква</summary>
        public const string UserName = @"^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$";

        /// <summary>Строчные и прописные латинские буквы, цифры</summary>
        public const string PassworsSimple = @"^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$";
        /// <summary>Строчные и прописные латинские буквы, цифры, спецсимволы. Минимум 8 символов</summary>
        public const string PassworsAdvanced = @"(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$";

        /// <summary>Дата в формате YYYY-MM-DD</summary>
        public const string DateStringYYYYMMDD = "[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])";
        /// <summary>Более строгая проверка даты в формате YYYY-MM-DD</summary>
        public const string DateStringYYYYMMDDAdvanced = @"(19|20)\d\d-((0[1-9]|1[012])-(0[1-9]|[12]\d)|(0[13-9]|1[012])-30|(0[13578]|1[02])-31)";

        public const string IntegerNumber = @"\-?\d+(\.\d{0,})?";
        public const string UUID = @"^[0-9A-Fa-f]{8}\-[0-9A-Fa-f]{4}\-[0-9A-Fa-f]{4}\-[0-9A-Fa-f]{4}\-[0-9A-Fa-f]{12}$";
        public const string GeographicsCoordinats = @"-?\d{1,3}\.\d+";
        public const string eMAil = @"^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$";
        public const string URL = @"~^(?:(?:https?|ftp|telnet)://(?:[a-z0-9_-]{1,32}"
            + @"(?::[a-z0-9_-]{1,32})?@)?)?(?:(?:[a-z0-9-]{1,128}\.)+"
            + "(?:ru|su|com|net|org|mil|edu|arpa|gov|biz|info|aero|inc|name|[a-z]{2})|(?!0)"
            + @"(?:(?!0[^.]|255)[0-9]{1,3}\.){3}(?!0|255)[0-9]{1,3})"
            + @"(?:/[a-z0-9.,_@%&?+=\~/-]*)"
            + "?(?:#[^ '\"&]*)?$~i";

        public const string TimeHHMMSS = @"^([0-1]\d|2[0-3])(:[0-5]\d){2}$";
        public const string MACAddress = "([0-9a-fA-F]{2}([:-]|$)){6}$|([0-9a-fA-F]{4}([.]|$)){3}";
        //public const string 
        //public const string 
        //public const string 
    }
}
